package tool;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class ShowVersion {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		if(args.length < 1){
			System.err.println("1 args needs [version file path]");
			return;
		}

		FileInputStream fis = null;
		DataInputStream dis = null;
		try {
			fis = new FileInputStream(args[0]);
			dis = new DataInputStream(fis);
			System.out.println(String.format("*** Resource Version = %04d ***", (int)dis.readChar()));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}finally{
			try {
				dis.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
			try {
				fis.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}

}
